package com.code.day02;

import com.code.day02.utils.C3p0;
import org.junit.Test;

import java.sql.Connection;
import java.sql.PreparedStatement;

public class DemoC3p0 {
    @Test
    public void insert() throws Exception {
       Connection conn = C3p0.getConnection();
       PreparedStatement pst = conn.prepareStatement("insert into user(username, password) values(?,?)");
       pst.setString(1, "wssx");
       pst.setString(2, "213");
       pst.execute();

       C3p0.close(conn,pst,null);
    }
}
